$(function () {
    layui.use(['table','util'], function(){
        var table = layui.table,util=layui.util;
        table.render({
            elem: '#user'
            ,url:'../../user/showUser',
            method:'POST'
            ,even:true
            ,cols: [[
                {field:'id', title: 'ID'}
                ,{field:'avatar',style:'height:50px;', title: '头像',templet:function (d) { return '<div><img style="height: 50px" src='+d.avatar+'></div>' }}
                ,{field:'nickname', title: '昵称'}
                ,{field:'phone', title: '手机号'}
                ,{field:'createtime',title:'创建时间',templet: function(d) {return util.toDateString(d.createtime,"yyyy-MM-dd HH:mm:ss"); } }
            ]]
            ,page: false,
        });
    });
})